#include<stdio.h>

int main()
{
	char ch[4] = {'-' , '\\' , '|' , '/'};
	char str[101] = {0};
	int i = 0;
	for(i = 0;i < 100;++i){
		str[i] = '#';
		if(i <31)
			printf("\033[43;37m%-100s%d%%%c\r\033[0m",str,i + 1,ch[i % 4]);
		else if(i < 40)
			printf("\033[;33m%-100s%d%%%c\r\033[?25l",str,i + 1,ch[i % 4]);
		else if(i < 50)
			printf("\033[;32m%-100s%d%%%c\r\033[?25h",str,i + 1,ch[i % 4]);
		else if(i < 60)
			printf("\033[;34m%-100s%d%%%c\r\033[5m",str,i + 1,ch[i % 4]);
		else if(i < 70)
			printf("\033[;35m%-100s%d%%%c\r\033[1m",str,i + 1,ch[i % 4]);
		else
			printf("\033[;32m%-100s%d%%%c\r\033[0m",str,i + 1,ch[i % 4]);

		fflush(stdout);
		usleep(100000);
	}
	printf("\n");
	return 0;
}
